From eed7a00166ff82c9923bc67abf5efdb879e76f78 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerg=C5=91=20Tisza?= Date: Fri, 1 Apr 2016 15:08:18 +0300 Subject: [PATCH] Allow setting HTMLForm name Change-Id: I85f5492e0b99a5661dbed9814a0e3f3b9bc63d32 --- includes/htmlform/HTMLForm.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php index bf46e558ff..c3aa0448db 100644 --- a/includes/htmlform/HTMLForm.php +++ b/includes/htmlform/HTMLForm.php @@ -180,6 +180,7 @@ class HTMLForm extends ContextSource { protected $mSectionFooters = []; protected $mPost = ''; protected $mId; + protected $mName; protected $mTableId = ''; protected $mSubmitID; @@ -1006,6 +1007,9 @@ class HTMLForm extends ContextSource { if ( !empty( $this->mAutocomplete ) ) { $attribs['autocomplete'] = $this->mAutocomplete; } + if ( !empty ( $this->mName ) ) { + $attribs['name'] = $this->mName; + } return $attribs; } @@ -1347,6 +1351,16 @@ class HTMLForm extends ContextSource { return $this; } + /** + * @param string$ name 'name' attribute for the form + * @return HTMLForm $this for chaining calls + */ + public function setName( $name ) { + $this->mName = $name; + + return $this; + } + /** * Prompt the whole form to be wrapped in a "
", with * this text as its "" element. -- 2.20.1